package com.drg.center.service;

import cn.hutool.core.lang.tree.Tree;
import com.drg.center.entity.param.ResourcesAddDTO;
import com.drg.center.entity.param.ResourcesEditDTO;
import com.drg.center.entity.result.SysResVO;
import com.drg.center.entity.result.SysResourcesVO;
import com.guaike.core.entity.result.Result;
import com.drg.center.entity.SysResourcesPO;

import java.util.List;

/**
 * @Author: zhangxilin
 * @Date: 2023/10/30
 */
public interface SysResourcesService {

    /**
     * 构建树形
     * @param resourcesPOList
     * @return
     */
    List<SysResVO> buildTree(List<SysResourcesPO> resourcesPOList);

    /**
     * 资源树
     * @param onlyMenu
     * @return
     */
    Result<List<Tree<Long>>> findTree(String sysCode, Boolean onlyMenu);

    /**
     * 详情
     * @param id
     * @return
     */
    Result<SysResourcesVO> detail(Long id);


    /**
     * 添加
     * @param param
     * @return
     */
    Result<Boolean> add(ResourcesAddDTO param);

    /**
     * 编辑
     * @param param
     * @return
     */
    Result<Boolean> edit(ResourcesEditDTO param);

    /**
     * 删除
     * @param id
     * @return
     */
    Result<Boolean> delete(Long id);
}
